<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="关闭">
        <span aria-hidden="true">×</span>
    </button>
    <h4 class="modal-title" id="exampleModalTabs">修改对话信息</h4>
</div>
<div class="modal-body">
    <form class="form-horizontal">
        <div class="tab-content">
            {% csrf_token %}
            <div class="tab-pane active" id="exampleLine1" role="tabpanel">
                <div class="form-group hidden">
                    <label class="col-md-2 control-label" for="name">ID</label>
                    <div class="col-md-8">
                        <input type="text" class="form-control input-md" id="id" name="id" value="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="keyworld">关键词</label>
                    <div class="col-md-8">
                        <input type="text" class="form-control input-md" id="keyworld" name="keyworld" placeholder="请输入关键词" value="">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label" for="link">百度链接</label>
                    <div class="col-md-8">
                        <input type="text" class="form-control input-md" id="link" name="link" placeholder="请输入链接" value="">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label" for="remark">备注</label>
                    <div class="col-md-8">
                        <textarea class="form-control" id="remark" name="remark" placeholder="备注"></textarea>
                    </div>
                </div>

            </div>

        </div>
    </form>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-success" id="button_client_info_save">保存</button>
</div>

<script>
    (function ($) {
        $("#button_client_info_save").on('click', function () {
            var url = "create/0/";
            var data = $(".form-horizontal").serialize();

            $.post(url, data, function (result) {
                if(!result['status']){
                    toastr['error'](result['message']);

                }else{
                    toastr['success'](result['message']);

                    setTimeout(function () {
                        location.reload()
                    }, 1000);
                }
            }, 'json')

        })
    })(jQuery)
</script>

